home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / System / BoingBag1 / Contributions / InstallerNG / examples / properties.installer < prev    next >
Text File  |  1999-10-15  |  3KB  |  90 lines

  1.  
  2. /*
  3.  *
  4.  *
  5.  */
  6.  
  7. (user expert)
  8. (set @proceed-button "Show me more!"
  9.      @abort-button "Shit happens"
  10. )
  11.  
  12. ; *******************************************************************
  13. ; define some procedures (better: methods) which can
  14. ; operate on these objects
  15.  
  16. ; this will show the content of an "person" object
  17. (procedure P_showPerson
  18.            #p
  19.            (
  20.              (if (= "person" #p)  ; check for the right type
  21.                  (
  22.                    (message "Person's properties are\n\n"
  23.                             "Name: " (get-property #p "NAME") "\n"
  24.                             "Birthday: " (get-property #p "BIRTH") "\n"
  25.                             "Sex: " (if (get-property #p "SEX")
  26.                                         "Male"
  27.                                         "Female"
  28.                                     ) "\n"
  29.                    )
  30.                  )
  31.              )
  32.            )
  33. )
  34.  
  35. ; set the properties of a symbol (or, in an object-oriented
  36. ; manner: set an objects attributes)
  37. (procedure P_setPerson
  38.            #p
  39.            (
  40.              (if (= "person" #p)
  41.                  (
  42.                    (put-property #p "NAME" (askstring (prompt "Enter the name")
  43.                                                       (help "")
  44.                                                       (default "Savage")
  45.                                            )
  46.                    )
  47.                    (put-property #p "BIRTH" (askstring (prompt ("Enter %s's birthday" (get-property #p "NAME")))
  48.                                                        (help "")
  49.                                                        (default "01/01/1999")
  50.                                             )
  51.                    )
  52.                    (put-property #p "SEX" (askbool (prompt ("Enter %s's sex" (get-property #p "NAME")))
  53.                                                    (help "")
  54.                                                    (default 1)
  55.                                                    (choices "Male" "Female")
  56.                                           )
  57.                    )
  58.                  )
  59.              )
  60.            )
  61. )
  62.  
  63. ; *******************************************************************
  64.  
  65. (message "Welcome to a really cool example!\n\n"
  66.          "This will show you the usage of the new functions\n"
  67.          "SET-PROPERTY, GET-PROPERTY, REMOVE-PROPERTY, which\n"
  68.          "make you able to do some very simple Object-Oriented\n"
  69.          "stuff with the new InstallerNG!\n\n"
  70.          "Enjoy..."
  71. )
  72.  
  73. ; *******************************************************************
  74. ; first declare a object (i.e. symbol); the value of one symbol may
  75. ; stand for the "type" of this object (i.e. its class)
  76.  
  77. (set #savage "person")
  78.  
  79. (message "First, give me some data!")
  80. (P_setPerson #savage)
  81.  
  82. (message "Now let's see the data...")
  83. (P_showPerson #savage)
  84.  
  85. (exit (quiet))
  86. (welcome)
  87.  
  88.  
  89.  
  90.